const Koa = require('koa');
const app = new Koa()
const cors = require('@koa/cors');
const bodyParser = require('koa-bodyparser');
const articleRoutes = require('./router/article');
const useRouters =require('./router/index.js')


// 解决跨域
app.use(cors());

// 解析 JSON 请求体
app.use(bodyParser());

//前端访问接口
useRouters(app)


app.listen(3000, () => {
    console.log('Server is running on 3000');
})
